from fastapi import Request
from fastapi.responses import JSONResponse

from .custom_exceptions import NotFoundException


def not_found_handler(request: Request, exc: NotFoundException):
    return JSONResponse(
        status_code=404,
        content={"status": "error", "message": exc.detail, "data": None},
    )
